const inputDom = document.getElementById("inputDom");

function debounce(fn, wait) {
  let timer = null;
  return function () {
    if (timer) {
      clearTimeout(timer);
    }
    timer = setTimeout(() => {
      fn.apply(this, arguments);
    }, wait);
  };
}

inputDom.addEventListener(
  "input",
  debounce(function (e) {
    console.log(this);
    console.log(e.target.value, "value");
    console.log("发送请求");
  }, 500)
);
